package com.yuanxiao.common.core.utils;

import cn.hutool.core.date.DateUtil;
import sun.misc.BASE64Decoder;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Date;

/**
 * Author: cg
 * Date: 2021-09-15 12:49
 * Content:
 */
public class ImgUtils {

    /**
     * base64转图片
     * @param base64str base64码
     * @param savePath 图片路径
     * @return
     */
    public static String GenerateImage(String base64str, String savePath,String visitUrl,String fileName) {
        String shortPath = String.format("%s/%s",savePath,DateUtil.format(new Date(), "yyyyMMdd"));
        String visitShortPath = String.format("%s/%s",visitUrl,DateUtil.format(new Date(), "yyyyMMdd"));
        String pathAll = String.format("%s/%s%s",shortPath,fileName,".jpg");
        String realPathAll = String.format("%s/%s%s",visitShortPath,fileName,".jpg");
        //对字节数组字符串进行Base64解码并生成图片
        if (base64str == null) {
            return "";
        }
        BASE64Decoder decoder = new BASE64Decoder();
        try {
            //Base64解码
            byte[] b = decoder.decodeBuffer(base64str);
            for (int i = 0; i < b.length; ++i) {
                //调整异常数据
                if (b[i] < 0) {
                    b[i] += 256;
                }
            }
            File fileReal = new File(pathAll);
            if(!fileReal.getParentFile().exists()) {
                fileReal.getParentFile().mkdirs();
            }
            //生成jpeg图片
            OutputStream out = new FileOutputStream(pathAll);
            out.write(b);
            out.flush();
            out.close();
            return realPathAll;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }


    /**
     * base64转图片
     * @param base64str base64码
     * @param savePath 图片路径
     * @return
     */
    public static String base64ToJpegOrPng(String base64str, String savePath,String fileShootName,String type) {
        String writePath = String.format("%s%s.%s",savePath,fileShootName,type);
        //对字节数组字符串进行Base64解码并生成图片
        if (base64str == null) {
            return "";
        }
        BASE64Decoder decoder = new BASE64Decoder();
        try {
            //Base64解码
            byte[] b = decoder.decodeBuffer(base64str);
            for (int i = 0; i < b.length; ++i) {
                //调整异常数据
                if (b[i] < 0) {
                    b[i] += 256;
                }
            }
            File fileReal = new File(writePath);
            if(!fileReal.getParentFile().exists()) {
                fileReal.getParentFile().mkdirs();
            }
            //生成jpeg图片
            OutputStream out = new FileOutputStream(writePath);
            out.write(b);
            out.flush();
            out.close();
            return writePath;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    public static byte[] imageToBytes(BufferedImage bImage, String format) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            ImageIO.write(bImage, format, out);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return out.toByteArray();
    }

//    public static void main(String[] args) {
//        String str = "UklGRqQ6AABXRUJQVlA4IJg6AADwfAGdASogA0YCPsFeqE6npSQiKLII2PAYCU3fi/cJmhO4xbOnrEFNH/C7UGLfSP63/A/4z/z/4r32+O+5j2P99+3H3zd3kcL25+4v//qt/4/q+/i/+v9hD+E/3zqN/8XzpurNjlfra/wfJJvlX+m9DXzX+a2gDBHW37dvaf80NQj8g/ovqjRUnFnvx5w+0HQf+36MDPz/o9Ed/7juS09PYHF6AhfjStQoJl/UVMElNvSqkD4QndFhHzf8ALJ0B6gxMCOJX2wCurMWB1cv38nVlVcEdYU6ng1FcKJ66ZA7IcLT09gcXoCF8AU5Uo7BhwRQZNCfWuG2GZVkifbLbre5PXQqkROkQYTyME2X7gDZoHEHKfgqnu1AKqd8B0G5UKpLT09gcXoCF+VC5DhaeO3WNHNWNP9NBBVTBtajT3kRYpgHHfo4B8yIUDf+31qDLJiv8ZWYIfc9X8wgKAyurbfmeK8YRel0vXhaensDi9AQvyoXIcLT08zTPXqixyMvBG6uHBQDE6pSab1glQy+F8fVnskTcN6vuatmzqQQ5neF44k9R66ZA7IcLT09gcXoB/ADOL4ApypTIwGXWaJvDlQfxoNhRIt5X3LPMq8+Zfvz8B1iqFdV6ULfLWNc+ARCIEM37vtPdMgdkG6nlgwOhWhC59XPz6boIoGgXPtooGCj/C6tq+ffq37//Nyb7QK8WILeVFuXHPqUeHvsfivu+3oCF+VA/Nv6UKKq86T5qUuShWC9EuMXow7IcLT/Zt9kQkcrydKrvCjASQtNuwN8CNA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